package com.jf.service.impl;

import com.jf.bean.Enterprise;
import com.jf.dao.EnterpriseDao;
import com.jf.dao.impl.EnterpriseDaoImpl;
import com.jf.service.EnterpriseService;
import com.jf.util.MyConstants;
import com.jf.util.ResultJson;

public class EnterpriseServiceImpl implements EnterpriseService {
    private EnterpriseDao enterpriseDao = new EnterpriseDaoImpl();
    @Override
    public ResultJson getInfo() {
        Enterprise enterprise = enterpriseDao.getById(MyConstants.WEBSITE_ID);
        return ResultJson.success(enterprise);
    }

    @Override
    public ResultJson update(Enterprise enterprise) {
        enterprise.setId(MyConstants.WEBSITE_ID);
        int result = enterpriseDao.update(enterprise);
        return result>0?ResultJson.success():ResultJson.error("修改失败！");
    }
}
